Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

fix: reduce the number of concurrent requests in browser #505

Merged
merged 3 commits into from
Aug 27, 2019

Conversation

alanshaw
Copy link
Contributor

@alanshaw alanshaw commented Jul 25, 2019

In the browser we can only make 5 concurrent requests to the same origin.

This PR also refactors the pubsub tests to use async/await and be less flakey.

Alan Shaw added 3 commits July 26, 2019 20:16
In the browser we can only make 6 concurrent requests to the same origin.

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
@alanshaw alanshaw force-pushed the fix/max-pubsub-reqs-browser branch from c299a89 to f10b145 Compare July 26, 2019 19:17
@alanshaw alanshaw merged commit 7596634 into master Aug 27, 2019
@alanshaw alanshaw deleted the fix/max-pubsub-reqs-browser branch August 27, 2019 13:34
alanshaw pushed a commit to ipfs-inactive/js-ipfs-http-client that referenced this pull request Aug 28, 2019
This PR enabled pubsub in the browser and paves the way for a switch to using `fetch` by default and allowing for cancelable requests via the use of `AbortController`.

It's mostly the work done in ipfs-shipyard/js-ipfs-http-client-lite#1 but adapted a bit for use here.

If approved, we can start work moving the other commands to use `fetch`. The work in https://github.com/ipfs-shipyard/js-ipfs-http-client-lite has proven the hard parts (uploading files) are all possible using the `fetch` API.

Since `fetch` is promise based, when moving the other commands it makes sense to just switch to async/await as per ipfs/js-ipfs#1670 (and callbackify instead of promisify).

Depends on:

* [x] ipfs-inactive/interface-js-ipfs-core#505

resolves #518
refs ipfs/js-ipfs#2093
resolves #932

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants